#pragma once

#include "Affichage.h"
#include "Global.h"

using namespace std;

class Epee
{
	public :
		Epee(Affichage& oAffichage);

		TypeEpee getTypeEpee();
		bool setTypeEpee(TypeEpee type);
		bool hasEpee();

		void draw(int persoX, int persoY, TypeAnim anim, TypeDirection direction, int frame, int charge = 0);

		~Epee();

	private :
		void getClip(SDL_Rect& src, TypeAnim anim, TypeDirection direction, int frame);
		void correctionMouvement(SDL_Rect& corEpee, TypeAnim anim, TypeDirection direction, int frame, int clip = 0);
		void drawEtoilesCharge(int xEpee, int yEpee, TypeDirection direction, int charge);
		void drawEtoilesSpin(int persoX, int persoY, TypeDirection direction, int charge);

		//Spin
		void getClipSpin(SDL_Rect& src, int clip);
		void positionEpeeSpin(SDL_Rect& posEpee, int clip);

		Affichage& oAffichage;

		SDL_Surface* imageEpee;
		SDL_Surface* imageSpin;
		SDL_Rect clip[4];
		TypeEpee type;
};
